from sbprice import *

s = Solution(0, 0)


def buy(price, size):
    s.buy(SB(price, size, 0, 0, True))


def sell(price, size):
    s.sell(SB(price, size, 0, 0, False))


def t(size, buy_price, sell_price):
    buy(buy_price, size)
    sell(sell_price, size)


def g(number, buy_price, sell_price):
    t(number, buy_price, sell_price)


def go():
    # a = 430000 + (520000 + 50000) + 30000
    # b = 18600 + 1200 + 800
    # # c = 35.70  # 36.76
    # print(
    #     f"""
    #     现值{c}
    #     平均{round(a / b,2)}
    #     偏离{round(c - a / b ,2)} , {round(round(c - a / b ,2) * b,2)}
    #     偏离{round((a / b - c) / (a / b) * 100, 2)}%
    #     修正{round((a / b - c) / c * 100 , 2)}%"""
    # )
    # t(200, 40.24, 41.19)
    # t(200,36.50,36.70)
    # t(600,36.49,36.70)
    # t(12500,36.85,37)
    c = 36.38
    g(3000,36.77,c)
    g(5000,36.70,c)
    g(5400,36.70,c)
    s.show()
    print("%31.2f" % s.tot)


go()

print(13300 * 1.5 / 490000)